<?php
//$country_sql = "DROP TABLE IF EXISTS `".$country_db_table_name."`;";
global $country_db_table_name;
$country_sql = "
CREATE TABLE IF NOT EXISTS `".$country_db_table_name."` (
  `country_id` int(11) NOT NULL AUTO_INCREMENT,
  `country` char(2) NOT NULL DEFAULT '',
  `title` varchar(64) DEFAULT NULL,
  `tag` int(11) DEFAULT NULL,
  `status` enum('added','changed') DEFAULT NULL,
  PRIMARY KEY (`country_id`),
  UNIQUE KEY `country` (`country`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=238 ;";

$country_insert_sql = "INSERT INTO `".$country_db_table_name."` (`country_id`, `country`, `title`, `tag`, `status`) VALUES
(1, 'US', 'United States', 10, NULL),
(2, 'CA', 'Canada', 5, NULL),
(3, 'AF', 'Afghanistan', 0, NULL),
(4, 'AL', 'Albania', 0, NULL),
(5, 'DZ', 'Algeria', 0, NULL),
(6, 'AS', 'American Samoa', 0, NULL),
(7, 'AD', 'Andorra', 0, NULL),
(8, 'AO', 'Angola', 0, NULL),
(9, 'AI', 'Anguilla', 0, NULL),
(10, 'AQ', 'Antarctica', 0, NULL),
(11, 'AG', 'Antigua and Barbuda', 0, NULL),
(12, 'AR', 'Argentina', 0, NULL),
(13, 'AM', 'Armenia', 0, NULL),
(14, 'AW', 'Aruba', 0, NULL),
(15, 'AU', 'Australia', 0, NULL),
(16, 'AT', 'Austria', 0, NULL),
(17, 'AZ', 'Azerbaijan', 0, NULL),
(18, 'BS', 'Bahamas', 0, NULL),
(19, 'BH', 'Bahrain', 0, NULL),
(20, 'BD', 'Bangladesh', 0, NULL),
(21, 'BB', 'Barbados', 0, NULL),
(22, 'BY', 'Belarus', 0, NULL),
(23, 'BE', 'Belgium', 0, NULL),
(24, 'BZ', 'Belize', 0, NULL),
(25, 'BJ', 'Benin', 0, NULL),
(26, 'BM', 'Bermuda', 0, NULL),
(27, 'BT', 'Bhutan', 0, NULL),
(28, 'BO', 'Bolivia', 0, NULL),
(29, 'BA', 'Bosnia and Herzegovina', 0, NULL),
(30, 'BW', 'Botswana', 0, NULL),
(31, 'BV', 'Bouvet Island', 0, NULL),
(32, 'BR', 'Brazil', 0, NULL),
(33, 'IO', 'British Indian Ocean Territory', 0, NULL),
(34, 'BN', 'Brunei', 0, NULL),
(35, 'BG', 'Bulgaria', 0, NULL),
(36, 'BF', 'Burkina Faso', 0, NULL),
(37, 'BI', 'Burundi', 0, NULL),
(38, 'KH', 'Cambodia', 0, NULL),
(39, 'CM', 'Cameroon', 0, NULL),
(40, 'CV', 'Cape Verde', 0, NULL),
(41, 'KY', 'Cayman Islands', 0, NULL),
(42, 'CF', 'Central African Republic', 0, NULL),
(43, 'TD', 'Chad', 0, NULL),
(44, 'CL', 'Chile', 0, NULL),
(45, 'CN', 'China', 0, NULL),
(46, 'CX', 'Christmas Island', 0, NULL),
(47, 'CC', 'Cocos (Keeling) Islands', 0, NULL),
(48, 'CO', 'Colombia', 0, NULL),
(49, 'KM', 'Comoros', 0, NULL),
(50, 'CG', 'Congo', 0, NULL),
(51, 'CK', 'Cook Islands', 0, NULL),
(52, 'CR', 'Costa Rica', 0, NULL),
(53, 'CI', 'Cote d''Ivoire', 0, NULL),
(54, 'HR', 'Croatia (Hrvatska)', 0, NULL),
(55, 'CU', 'Cuba', 0, NULL),
(56, 'CY', 'Cyprus', 0, NULL),
(57, 'CZ', 'Czech Republic', 0, NULL),
(58, 'CD', 'Congo (DRC)', 0, NULL),
(59, 'DK', 'Denmark', 0, NULL),
(60, 'DJ', 'Djibouti', 0, NULL),
(61, 'DM', 'Dominica', 0, NULL),
(62, 'DO', 'Dominican Republic', 0, NULL),
(63, 'TP', 'East Timor', 0, NULL),
(64, 'EC', 'Ecuador', 0, NULL),
(65, 'EG', 'Egypt', 0, NULL),
(66, 'SV', 'El Salvador', 0, NULL),
(67, 'GQ', 'Equatorial Guinea', 0, NULL),
(68, 'ER', 'Eritrea', 0, NULL),
(69, 'EE', 'Estonia', 0, NULL),
(70, 'ET', 'Ethiopia', 0, NULL),
(71, 'FK', 'Falkland Islands (Islas Malvinas)', 0, NULL),
(72, 'FO', 'Faroe Islands', 0, NULL),
(73, 'FJ', 'Fiji Islands', 0, NULL),
(74, 'FI', 'Finland', 0, NULL),
(75, 'FR', 'France', 0, NULL),
(76, 'GF', 'French Guiana', 0, NULL),
(77, 'PF', 'French Polynesia', 0, NULL),
(78, 'TF', 'French Southern and Antarctic Lands', 0, NULL),
(79, 'GA', 'Gabon', 0, NULL),
(80, 'GM', 'Gambia', 0, NULL),
(81, 'GE', 'Georgia', 0, NULL),
(82, 'DE', 'Germany', 0, NULL),
(83, 'GH', 'Ghana', 0, NULL),
(84, 'GI', 'Gibraltar', 0, NULL),
(85, 'GR', 'Greece', 0, NULL),
(86, 'GL', 'Greenland', 0, NULL),
(87, 'GD', 'Grenada', 0, NULL),
(88, 'GP', 'Guadeloupe', 0, NULL),
(89, 'GU', 'Guam', 0, NULL),
(90, 'GT', 'Guatemala', 0, NULL),
(91, 'GN', 'Guinea', 0, NULL),
(92, 'GW', 'Guinea-Bissau', 0, NULL),
(93, 'GY', 'Guyana', 0, NULL),
(94, 'HT', 'Haiti', 0, NULL),
(95, 'HM', 'Heard Island and McDonald Islands', 0, NULL),
(96, 'HN', 'Honduras', 0, NULL),
(97, 'HK', 'Hong Kong SAR', 0, NULL),
(98, 'HU', 'Hungary', 0, NULL),
(99, 'IS', 'Iceland', 0, NULL),
(100, 'IN', 'India', 0, NULL),
(101, 'ID', 'Indonesia', 0, NULL),
(102, 'IR', 'Iran', 0, NULL),
(103, 'IQ', 'Iraq', 0, NULL),
(104, 'IE', 'Ireland', 0, NULL),
(105, 'IL', 'Israel', 0, NULL),
(106, 'IT', 'Italy', 0, NULL),
(107, 'JM', 'Jamaica', 0, NULL),
(108, 'JP', 'Japan', 0, NULL),
(109, 'JO', 'Jordan', 0, NULL),
(110, 'KZ', 'Kazakhstan', 0, NULL),
(111, 'KE', 'Kenya', 0, NULL),
(112, 'KI', 'Kiribati', 0, NULL),
(113, 'KR', 'Korea', 0, NULL),
(114, 'KW', 'Kuwait', 0, NULL),
(115, 'KG', 'Kyrgyzstan', 0, NULL),
(116, 'LA', 'Laos', 0, NULL),
(117, 'LV', 'Latvia', 0, NULL),
(118, 'LB', 'Lebanon', 0, NULL),
(119, 'LS', 'Lesotho', 0, NULL),
(120, 'LR', 'Liberia', 0, NULL),
(121, 'LY', 'Libya', 0, NULL),
(122, 'LI', 'Liechtenstein', 0, NULL),
(123, 'LT', 'Lithuania', 0, NULL),
(124, 'LU', 'Luxembourg', 0, NULL),
(125, 'MO', 'Macao SAR', 0, NULL),
(126, 'MK', 'Macedonia', 0, NULL),
(127, 'MG', 'Madagascar', 0, NULL),
(128, 'MW', 'Malawi', 0, NULL),
(129, 'MY', 'Malaysia', 0, NULL),
(130, 'MV', 'Maldives', 0, NULL),
(131, 'ML', 'Mali', 0, NULL),
(132, 'MT', 'Malta', 0, NULL),
(133, 'MH', 'Marshall Islands', 0, NULL),
(134, 'MQ', 'Martinique', 0, NULL),
(135, 'MR', 'Mauritania', 0, NULL),
(136, 'MU', 'Mauritius', 0, NULL),
(137, 'YT', 'Mayotte', 0, NULL),
(138, 'MX', 'Mexico', 0, NULL),
(139, 'FM', 'Micronesia', 0, NULL),
(140, 'MD', 'Moldova', 0, NULL),
(141, 'MC', 'Monaco', 0, NULL),
(142, 'MN', 'Mongolia', 0, NULL),
(143, 'MS', 'Montserrat', 0, NULL),
(144, 'MA', 'Morocco', 0, NULL),
(145, 'MZ', 'Mozambique', 0, NULL),
(146, 'MM', 'Myanmar', 0, NULL),
(147, 'NA', 'Namibia', 0, NULL),
(148, 'NR', 'Nauru', 0, NULL),
(149, 'NP', 'Nepal', 0, NULL),
(150, 'NL', 'Netherlands', 0, NULL),
(151, 'AN', 'Netherlands Antilles', 0, NULL),
(152, 'NC', 'New Caledonia', 0, NULL),
(153, 'NZ', 'New Zealand', 0, NULL),
(154, 'NI', 'Nicaragua', 0, NULL),
(155, 'NE', 'Niger', 0, NULL),
(156, 'NG', 'Nigeria', 0, NULL),
(157, 'NU', 'Niue', 0, NULL),
(158, 'NF', 'Norfolk Island', 0, NULL),
(159, 'KP', 'North Korea', 0, NULL),
(160, 'MP', 'Northern Mariana Islands', 0, NULL),
(161, 'NO', 'Norway', 0, NULL),
(162, 'OM', 'Oman', 0, NULL),
(163, 'PK', 'Pakistan', 0, NULL),
(164, 'PW', 'Palau', 0, NULL),
(165, 'PA', 'Panama', 0, NULL),
(166, 'PG', 'Papua New Guinea', 0, NULL),
(167, 'PY', 'Paraguay', 0, NULL),
(168, 'PE', 'Peru', 0, NULL),
(169, 'PH', 'Philippines', 0, NULL),
(170, 'PN', 'Pitcairn Islands', 0, NULL),
(171, 'PL', 'Poland', 0, NULL),
(172, 'PT', 'Portugal', 0, NULL),
(173, 'PR', 'Puerto Rico', 0, NULL),
(174, 'QA', 'Qatar', 0, NULL),
(175, 'RE', 'Reunion', 0, NULL),
(176, 'RO', 'Romania', 0, NULL),
(177, 'RU', 'Russia', 0, NULL),
(178, 'RW', 'Rwanda', 0, NULL),
(179, 'WS', 'Samoa', 0, NULL),
(180, 'SM', 'San Marino', 0, NULL),
(181, 'ST', 'Sao Tome and Principe', 0, NULL),
(182, 'SA', 'Saudi Arabia', 0, NULL),
(183, 'SN', 'Senegal', 0, NULL),
(184, 'YU', 'Serbia and Montenegro', 0, NULL),
(185, 'SC', 'Seychelles', 0, NULL),
(186, 'SL', 'Sierra Leone', 0, NULL),
(187, 'SG', 'Singapore', 0, NULL),
(188, 'SK', 'Slovakia', 0, NULL),
(189, 'SI', 'Slovenia', 0, NULL),
(190, 'SB', 'Solomon Islands', 0, NULL),
(191, 'SO', 'Somalia', 0, NULL),
(192, 'ZA', 'South Africa', 0, NULL),
(193, 'GS', 'South Georgia and the South Sandwich Islands', 0, NULL),
(194, 'ES', 'Spain', 0, NULL),
(195, 'LK', 'Sri Lanka', 0, NULL),
(196, 'SH', 'St. Helena', 0, NULL),
(197, 'KN', 'St. Kitts and Nevis', 0, NULL),
(198, 'LC', 'St. Lucia', 0, NULL),
(199, 'PM', 'St. Pierre and Miquelon', 0, NULL),
(200, 'VC', 'St. Vincent and the Grenadines', 0, NULL),
(201, 'SD', 'Sudan', 0, NULL),
(202, 'SR', 'Suriname', 0, NULL),
(203, 'SJ', 'Svalbard and Jan Mayen', 0, NULL),
(204, 'SZ', 'Swaziland', 0, NULL),
(205, 'SE', 'Sweden', 0, NULL),
(206, 'CH', 'Switzerland', 0, NULL),
(207, 'SY', 'Syria', 0, NULL),
(208, 'TW', 'Taiwan', 0, NULL),
(209, 'TJ', 'Tajikistan', 0, NULL),
(210, 'TZ', 'Tanzania', 0, NULL),
(211, 'TH', 'Thailand', 0, NULL),
(212, 'TG', 'Togo', 0, NULL),
(213, 'TK', 'Tokelau', 0, NULL),
(214, 'TO', 'Tonga', 0, NULL),
(215, 'TT', 'Trinidad and Tobago', 0, NULL),
(216, 'TN', 'Tunisia', 0, NULL),
(217, 'TR', 'Turkey', 0, NULL),
(218, 'TM', 'Turkmenistan', 0, NULL),
(219, 'TC', 'Turks and Caicos Islands', 0, NULL),
(220, 'TV', 'Tuvalu', 0, NULL),
(221, 'UG', 'Uganda', 0, NULL),
(222, 'UA', 'Ukraine', 0, NULL),
(223, 'AE', 'United Arab Emirates', 0, NULL),
(224, 'GB', 'United Kingdom', 0, NULL),
(225, 'UM', 'United States Minor Outlying Islands', 0, NULL),
(226, 'UY', 'Uruguay', 0, NULL),
(227, 'UZ', 'Uzbekistan', 0, NULL),
(228, 'VU', 'Vanuatu', 0, NULL),
(229, 'VA', 'Vatican City', 0, NULL),
(230, 'VE', 'Venezuela', 0, NULL),
(231, 'VN', 'Viet Nam', 0, NULL),
(232, 'VG', 'Virgin Islands (British)', 0, NULL),
(233, 'VI', 'Virgin Islands', 0, NULL),
(234, 'WF', 'Wallis and Futuna', 0, NULL),
(235, 'YE', 'Yemen', 0, NULL),
(236, 'ZM', 'Zambia', 0, NULL),
(237, 'ZW', 'Zimbabwe', 0, NULL);";

global $wpdb;
$wpdb->query($country_sql);
$wpdb->query($country_insert_sql);
?>